wordpressfandomcom_zh-20200215-history
FAQ Layout and Design
Back to FAQ __TOC__ Layout I am having trouble with my CSS so where can I find help? The following are articles that will help you troubleshoot and solve many of your CSS problems: * Blog Design and Layout * Finding Your CSS Styles * CSS Fixing Browser Bugs * CSS Troubleshooting * WordPress CSS Information and Resources Where can I get some buttons for my site? Buttons are like badges you display on your website to show your affection for something, or to display information regarding your cultural, social, political or technical leanings. To add a WordPress button to your site showing support for the WordPress Community: *Contributing to WordPress, Show you Care For more buttons, see: * GtmcKnight's Steal these Buttons * Adam Kalsey's Buttonmaker How can I choose different styles or colours for my comments? There are several different plugins available to help you change the look, layout, and colours of your comments at Comment Plugins. How do I change the size of the popup comments window? To change the look of the Popup Comments window in WordPress version 1.5, make changes to the comment-functions.php file where it shows the following line: function comments_popup_script($width=400, $height=400, $file='') {. To change the look of the Popup Comments window in WordPress version 1.2.1 Mingus, make the following change to the template-functions-comment.php on line 50: function comments_popup_script($width=400, $height=400, $file='wp-comments-popup.php') You can also change Line 81 of wp-comments-popup.php to alter the textarea size for people entering comments. How do I show an excerpt or teaser for an article on the weblog homepage? An excerpt should not be confused with the teaser which refers to the first few sentences or paragraphs of a post. When typing a long post you can insert the Quicktag after a few sentences to act as a cut-off point. When the post is displayed, the teaser, followed by a hyperlink (such as Read the rest of this entry...), are displayed. Your visitor can then click on that link to see the full version of your post. Note that some Themes may not support the more ability. More information on how to present the more information can be found at Template Tag the_content() and Customizing the Read More. As stated before, recognize that use of the more feature should not be confused with the Excerpt field in your Administration > Write > Write Post Panel. The Template Tag the_excerpt() can be used to access the contents of this field. How do I customise the text shown in "(more.....)" on my weblog? See also: *Customizing the Read More Where can I find some other Themes and templates to use for styling my blog? * WordPress Theme Viewer * Blogging Pro features a whole category of WordPress Themes * The "official" WordPress Theme List * Alex King's WordPress Theme Competition Where can I find information about styling lists and nested lists? See also: *Styling Lists with CSS How do I change the way menu links are listed? See also: *Styling Lists with CSS How can I get my categories to display in the order I want? Two tags are involved in genearated your category list. For more information on setting the order and look of these see list_cats() and wp_list_cats(). How do I get rid of the bullet points next to my links? See also: *Styling Lists with CSS How can I create horizontal menus? See also: *Creating Horizontal Menus How do I show only the titles of articles on the weblog homepage? To show only the title of posts on the weblog homepage, in index.php replace With something like: This will show the post content only on the individual posts page. Where should I look for more information on CSS? See also: *CSS Can I add music for my visitors? See also: *Plugins/Audio Mood *Ross Angus' Standards Compliant method to add MP3s to pages Design Elements Can I show the RSS feed from other sites on my blog ? See also: * Plugins/Syndication * FOF Powered Subscriptions Page Hack. How can I get my links to open in a new window? Opening links in a new window is considered bad form in today's web as it has been abused. Yet, it still serves a purpose for demonstration sites that require more than one window open at a time. This method will work for those links that you enter into the body of a post. After entering the link using the Quicktags button for "link", add target="_blank" to the individual*- link you want to have open in a new window when clicked. Consider adding text indicating that this link will open a new window, as required by web accessibility standards. Page Title (Opens in new window) Is there a tool to encode HTML entities and tags so I can display code on my weblog? The article Writing_Code_in_Your_Posts will help you write programming code and code examples in your posts. The Encode tool will convert your HTML/XHTML code into a form that can be displayed on your blog without it being treated as HTML by browsers. There are also WordPress Plugins and other tools available to help integrate this proces into your site if you use it frequently to display codes. * Scott Yang's Syntax Highlighting with Enscript in WordPress * Owen Winkler's Code Filter Also see: Fun Character Entities How do I use the links rating feature to display the ratings? In WordPress 1.5 you have the option to rate the links in your Link Manager and display the ratings for the world to see. To rate your links, edit the particular link (by using the “Links�? interface), and rate the link from 0 - 10 using the dropdown menu. In WordPress 1.2, to display your link ratings, it is necessary to edit the link categories with the links that you want to display the ratings for to show the ratings (Links -> Link Categories -> Show -> Rating) Once that is done, you can display the ratings using a. a character (which you can specify in Options -> Link Manager -> links_rating_char – * by default) b. a number (the rating, 0-9) c. Images. You can choose one of the above methods in Options -> Link Manager -> links_rating_type If you are using Images, you have the choice to use the same image (tick- rating image) displayed n times to show a rating of n (Set by choosing True for Options -> Link Manager -> links_rating_single_image ) or using 10 different images, for one through 10. For example, the image used for showing a rating of 9 is: http://faq.wordpress.net/wp-images/links/rating-9.gif You can changes the images used by entering the relative URLs for the ratings images you want to use at Options -> Link Manager How do I do a dropcaps on the first letter of a post? DropCaps is the name for the effect where the first letter of the first paragraph in an article “drops�? blow the line, and is displayed in a larger font-size than the other normal letters, for an interesting and professional look. This can be done using BBCode quicktags. First, add this to your style sheet: #fp:first-letter { font-size : 300%; font-weight : bold; float : left; margin-right: 3px; } then add following code to file /wp-admin/quicktags.js and put them among edButtons: edButtonsedButtons.length = new edButton('ed_capdrop' ,'CapDrop' ,' ' ,' ' ,'c' ); You will see a CapDrop quicktag in your edit window. That’s it. Information above was provided by Mulberry at http://yanfeng.org/blog/index.php?p=380 See also: * drop caps 如何在你的网站添加favicon.ico 在WordPress中，把'favicon.ico' 文件放在你当前主题文件夹的下面(例如: wp-content/themes/default/) 并在''header.php''适当(直接)插入: Images and Graphics How do I get WordPress to generate links to the thumbnail of an uploaded picture? WordPress by default only produces very limited code after uploading a picture. If you want to get code for the thumbnail link, the thumbnail etc, autogenerated, the following resources will be useful, including a possible hack that may not work for WordPress v1.5 at Thumbnail HTML addition for upload.php. See also: *Using Images *Image Plugins List *Photoblogs and Galleries How can I use a custom image for my list bullets? See also: *Styling Lists with CSS *Customizing Your Sidebar How do I rotate/cycle/randomize the image in the header of the weblog? See also: *Designing Headers, Rotating Header Images How do I link to my own images? You can use absolute or relative URI/URLs addresses. To use a relative link, set the address from the root folder of your site by using a slash in front of the folder in the root directory. To use an absolute link: How can I display images in my category and archive pages? When using the default theme, you'll notice images (and links) do not appear when visiting category and archive query pages. This has to do with how the default theme displays post content in those sections of your blog. To change this behavior, edit the default theme's Archive Template (archive.php). You can do this online through the Theme Editor, or offline by downloading and opening the default theme's archive.php in any text editor. Once in the Archive Template, look for this section: Here, change the_excerpt() template tag, which displays a summary of a post's content while filtering out all HTML tags. To display each post's whole content (and HTML tags), use the_content() template tag: Where can I find more information on images, PhotoBlogs, and photo galleries? See also: *Using Images *Photoblogs and Galleries *Image Plugins How do I add a favicon? To add a favicon to your site in WordPress 2.0, place your favicon.ico file inside your theme folder (for example: wp-content/themes/default/) then add this line to header.php: Be sure to add it somewhere within the section. See also: * Designing Headers Template Tags How do I change time stamp for each post change from an AM/PM mode to a 24 hour mode? You set the Default Time Format for your blog via the Administration > Options > General Panel under the Date and Time section. See also: *Formatting Date and Time How can I have the date/time displayed on every entry I make? To put the date and time on every post title on your site, you may have to change more than one template file. They may include index.php, single.php, category.php, and archives.php. From among the various template files, find all references to the title of your post like this (your Theme version may be slightly different): by Rearrange it so the time information goes in front (or in back) of your Post Title: - by See also: *Formatting Date and Time How do I change the "Permanent Link to" in my Title link? The title of your links includes text that explains what the link is to, in concordance with web accessibility standards. By default, your title may look like this example, which uses the title attribute with the words "Permanent Link to" and the template tag that displays the title of the post. To change the "Permanent Link to" text, simply delete it and replace it with your own words: Or remove it completely, leaving only the title tag. How do I make my Categories appear in alphabetical order? In some cases it may be necessary to change index.php. Find this line: and replace it with this line instead: See also: *Template Tags/wp_list_cats and Template Tags/list_cats How do I make my categories appear in a drop down list ? In some cases it may be necessary to change index.php. Find this line: and replace it with this line instead: See also: *Template_Tags/dropdown_cats How do I exclude one or more categories from being listed in the list of categories? Use the following function to list your categories but exclude category 1: Of course, change the 1''' to the ID of the category you want to exclude. To exclude multiple categories, use this: Change 1 and 2 to the categories you want excluded. You can exclude more of them by adding their IDs separated by commas. See also: *Template Tags/wp_list_cats and Template Tags/list_cats How do I hide a category from the front page index.php? If you need to exclude a category from the front page, you can place code that does the exclusion inside The Loop of your theme's index.php file. The Loop starts something like this: To exclude category 4 from the front page, just inside The Loop, add this condition : This means that if on the front page, the post will be presented if it's not in category 4. On pages other than the front ( home ) page, all posts are presented. See also: *Exclude Posts From Some Category How do I make my Archives appear in a drop-down list? Put this code into your index.php where you wish the item to appear: Archives: By Month < ?php get_archives(,'','option', 1); ?> How can I customize the ''more tag? See also: *Customizing the Read More Templates Why can I see only n posts on the blog, where are the other entries? Make sure that you have the correct settings in the '''Show at most posts or days fields in the Administration > Options > Reading Panel. If you are not seeing all your entries and you modified the default index.php, make sure you have an equal number of opening and closing tags, and that they are in the right places. How do I create an archives page, with all the entries sortable by different methods? See also: *Creating an Archive Index *Plugins *Another Nicer Archives Version *Sporadic Nonsense's Clean Archives Plugin What do the _() and _e() functions in WordPress do? In the simplest of terms, they "print" what you tell them to do. They are abbreviations for the PHP term "echo" which displays text. In WordPress, they are used to identify strings in the php files marked for translation to other languages, and localization using two "tags" which are actually functions. They are: * __() * _e() These accept a string as an argument. For example: __("Translate Me") _e("Translate Me") The only functional difference between the two methods is that _e() echoes the string and () simply returns the string. () is used when you want to supply a string to a function. _e() is used when you want to output the string as part of your XHTML. We have a tool which goes through all of the php files, extracting strings that are marked by __() and _e(). See also: *Conditional Tags Themes How do I use a Theme style from Alex King’s site? See also: *Using Themes *Using Themes/Theme List * Alex Kings Theme Competition Which files do I modify when I start to design my site? See also: *Working with WordPress, Site Development How do you create a screenshot.png for your Theme? See also: *Tanster's Quick and dirty way to create screenshot.png Back to FAQ Category:Copyedits Category:Design and Layout Category:Troubleshooting Category:WordPress Help